package com.zhibang.report.service.impl;

import com.sannuo.common.domain.Consumer;
import com.zhibang.report.dao.ConsumerMapper;
import com.zhibang.report.service.ConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ConsumerServiceImpl implements ConsumerService {
    @Autowired
    private ConsumerMapper consumerMapper;
    @Override
    public List<Consumer> selectConsumer() {
        List<Consumer> consumers = consumerMapper.selectConsumer();
        for (Consumer consumer : consumers) {
            System.out.println(consumer);
            Integer zh =0;
            Integer countOfTest = consumer.getCountOfTest();
            Double medicalReference = consumer.getMedicalReference();
            zh=(int) (countOfTest * medicalReference*100);
            System.out.println(zh);
            consumer.setZh(zh+"%");
        }
        return consumers;
    }
}
